home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 119_01.zip / MLIST.C < prev    next >
Text File  |  1993-06-16  |  768b  |  41 lines

  1. #include bdscio.h
  2. #define DEL1    0x1f    /* C-<underbar> */
  3. #define DEL2    0x1e    /* C-<caret> */
  4.  
  5. main(argc,argv)
  6. char **argv;
  7. {
  8.     char ibuf[BUFSIZ];
  9.     char line[132];
  10.     int ifd, on, lcount, i;
  11.     on = i = lcount = 0;
  12.     if (argc != 2) {
  13.         printf("Usage:\nMlist infile outfile");
  14.         exit();
  15.     }
  16.  
  17.     if (fopen(argv[1],ibuf) == -1){
  18.         printf ("File open error on %s",argv[1]);
  19.         exit();
  20.     }
  21.     printf ("%s",argv[1]);
  22.     while (fgets(line,ibuf) != 0){
  23.         lcount++;
  24.         if (DEL2 == line[0]){
  25.             if (on) do {
  26.                 lcount++;
  27.                 fputs("     \n",2);
  28.             }while (lcount <= 12);
  29.             on = 0;
  30.         }else if (DEL1 == line[0]) {
  31.             on = 1;
  32.             lcount = 0;
  33.         }else if (on){
  34.             fputs(line,2);
  35.         }
  36.     }
  37.     fclose (ibuf);
  38. }
  39.  
  40.  
  41. èMOORE at USC-ISIBèèDave SmithèèRequest: May 4 1981èDW